import { Cell } from '../../cors/cell';
import { Injectable, Inject } from '../../decorators/inject';
import { toJSON, Transform } from '../../decorators/toJSON';
import { ICellRender } from '../types';
import { NExcel } from '../../types';
import { Config } from '../../cors/config';
import { ARenderBase } from '../render.base';
@Injectable()
@Transform()
export class TextRender extends ARenderBase implements ICellRender {
    @toJSON('kpd-text')
    protected type: 'text'|'number'|'formula'|'string' = 'text';
    @toJSON(null)
    protected value: any = null;
    public cell: Cell;
    protected ctx: CanvasRenderingContext2D;
    protected catch: any = null;
    constructor(
        @Inject(NExcel.TableDataCanvasToken) protected canvasDataEle: HTMLCanvasElement,
        protected conf: Config
    ) {
        // console.log(this);
        super();
    }
    public init(value: any): void {
        this.ctx = this.canvasDataEle.getContext('2d');
        if(value) {
            this.value = value;
        }
    }
    public catchRenderTime(deps: any) {
        
    }
}
